<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>

<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="/assets/public/img/user.png">

    <title><?=$title?></title>

    <!-- 框架 -->
    <script src="/assets/frameworks/jquery/jquery.min.2.2.js"></script>
    <link href="/assets/frameworks/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <script src="/assets/frameworks/bootstrap/js/bootstrap.min.js"></script>
    <link href="/assets/frameworks/font-awesome/css/font-awesome.min.css" rel="stylesheet">

    <!-- 插件 -->
    <script src="https://cdn.bootcss.com/jquery-validate/1.17.0/jquery.validate.min.js"></script>
    <script src="https://cdn.bootcss.com/jquery-validate/1.17.0/localization/messages_zh.js"></script>

    <!-- 引入自定义样式 -->
    <link href="/assets/public/css/main.css" rel="stylesheet">
    <link href="/assets/public/css/login.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
    <![endif]-->

</head>

<body>

<!-- 静态导航 -->
<div class="navbar navbar-inverse navbar-static-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <img width="250px" src="/assets/public/img/login.png" alt="Li Lijie - 后台登录">
        </div>
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav navbar-right">
                <li>
                    <a href="/">
                        <span class="fa fa-home"> 首页</span>
                    </a>
                </li>
            </ul>
        </div><!--/.nav-collapse -->
    </div>
</div>

<!-- +++++ 内容 - 管理员登录 +++++ -->

<div class="htmleaf-container">
    <div class="pink">
        <div class="container">
            <div class="row">
                <div class="col-lg-6 col-lg-offset-3">

                        <!-- +++++ 表单录入部分 +++++ -->
                        <form class="form-horizontal" method="post" action="/admin/login/in">
                            <span class="heading">Login</span>
                            <div class="form-group">
                                <input name="name" type="text" class="form-control" placeholder="账　号" value="<?=$name?>">
                                <i class="fa fa-user"></i>
                            </div>
                            <div class="form-group">
                                <input name="psw" type="password" class="form-control" placeholder="密　码" value="<?=$psw?>">
                                <i class="fa fa-lock"></i>
                            </div>
                            <div class="form-group" style="text-align: right;">
                                <table width="100%">
                                    <tr>
                                        <td align="left" width="70%">
                                            <input name="code" type="text" class="form-control" placeholder=" 请输入图片验证码">
                                            <i class="fa fa-image"></i>
                                        </td>
                                        <td align="center" width="30%">
                                            <img src="/admin/login/code" alt="图片验证码"
                                                 onclick= this.src="/admin/login/code/"+Math.random()
                                                 style="cursor: pointer;"
                                                 title="点击更换"/>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <div class="form-group">
                                <div class="main-checkbox">
                                    <input type="checkbox" value="None" id="checkbox1" name="check"/>
                                    <label for="checkbox1"></label>
                                </div>
                                <span class="text">Remember me</span>
                                <button type="submit" class="btn btn-default">登录</button>
                            </div>
                        </form>

                </div>
            </div>
        </div>
    </div><!-- /.white -->
</div><!-- /.htmleaf -->

<!-- +++++ 表单验证部分 +++++ -->
<script>
    $().ready(function() {
        // 在键盘按下并释放及提交后验证提交表单
        $(".form-horizontal").validate({
            errorElement: "span",
            errorClass: "fa fa-exclamation-circle",
            rules: {
                name: "required",
                psw: "required",
                code: "required"
            },
            messages: {
                name: " 请输入账号",
                psw: " 请输入密码",
                code: " 请输入验证码"
            }
        });
    })
</script>